package com.hulk.ratel.common.constant.enums;

import com.google.common.base.Objects;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by hulk on 2017/5/8.
 */
@Getter
@AllArgsConstructor
public enum TxnLogStatus {



	/**
	 * 交易成功
	 */
	SUCCESS("SUCCESS","交易成功"),

	/**
	 * 交易失败
	 */
	FAILED("FAILED","交易失败"),

	/**
	 * 交易已创建
	 */
	CREATED("CREATED","交易已创建"),

	/**
	 * 交易超时
	 */
	TIMEOUT("TIMEOUT","交易超时"),
	
	/**
	 * 处理中
	 */
	PROCESSING("PROCESSING","处理中"),
	
	
	/**
	 * 订单已取消
	 */
	CANCELED("CANCELED","订单已取消"),
	
	/**
	 * 交易已取消
	 */
	REFUNDED("REFUNDED","订单已退款"),

	/**
	 * 等待支付
	 */
	WAITING("WAITING","等待支付");

	

	private String value;
    private String desc;


	public static String explain(String value) {
		for (TxnLogStatus obj : TxnLogStatus.values()) {
			if (Objects.equal(value, obj.value)) {
				return obj.desc;
			}
		}
		return value;
	}
	

}
